<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="./suwell_ofdReader.js" type="text/javascript"></script>
    <script src="../config/config.project.js" type="text/javascript"></script>
    <script>
        var ocx;
        function initObject()
        {
            //注意：插件宽高设固定值。
            ocx = suwell.ofdReaderInit("OFDActiveXDIV","100%","1000px");

            //此监听用于判断远程保存文件的成败。如果此监听被触发说明文件保存成功。如果不被触发说明文件保存失败。
            if(ocx)
            {
                ocx.registListener("f_saveurl","savePerformed",true);
            }
        }


        function savePerformed()
        {
            alert("盖章成功,请刷新处理单");
            window.close();
        }

        //打开远程服务上的文件。
        function openFile()
        {
            var src= window.location.href;
            var unid= src.substr(src.indexOf("?unid=")+6);
            initObject();
            console.log("ofd打开的地址")
            console.log((localStorage.getItem("local_server_ip") || window.HC_config.VUE_APP_BASE_API) + "/gwfj/word-files/download/"+unid,(localStorage.getItem("local_server_ip") || window.HC_config.VUE_APP_BASE_API) + "/gwfj/filedata/uploadOFD/"+unid)
            ocx.openurl((localStorage.getItem("local_server_ip") || window.HC_config.VUE_APP_BASE_API) + "/gwfj/word-files/download/"+unid,(localStorage.getItem("local_server_ip") || window.HC_config.VUE_APP_BASE_API) + "/gwfj/filedata/uploadOFD/"+unid,false);
        }
    </script>
</head>
<body onload="openFile()">
<div id="OFDActiveXDIV" style="margin:0 auto"></div>
</body>
</html>